<template>
  <div id="container" :data="data">
    <chartTitle :title="title"></chartTitle>
    <div class="main">
      <div :key="index" v-for="(item, index) in data">
        <p class="p1" :style="item.label=='预警数'?'color:#FDBE15;':''">{{ item.value }}</p>
        <p class="p2">{{ item.label }}</p>
      </div>
      <!-- <div>
        <p class="p1">122</p>
        <p class="p2">案事件数</p>
      </div>
      <div>
        <p class="p1">122</p>
        <p class="p2">结案数</p>
      </div>
      <div>
        <p class="p1">122</p>
        <p class="p2">结案率</p>
      </div> -->
    </div>
  </div>
</template>

<script>
import chartTitle from '../chart-title/index.vue'
export default {
  components: {
    chartTitle
  },
  name: 'itemBox',
  props: {
    title: String,
    data: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {}
  },
  mounted() {
    this.onInit()
  },

  methods: {
    onInit() {}
  }
}
</script>

<style lang="less" scoped>
#container {
  width: 100%;
  height: 20.4vh;
  color: #fff;
  background-color: rgba(7, 38, 46, 0.2);
  // border: 1px solid rgba(194, 215, 253, .2);
  .main {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    > div {
      width: 23%;
      text-align: center;
      padding-top: 1.8vh;
      height: 9vh;
      line-height: 3vh;
      background-image: url(../../image/index/itemBg1.png);
      background-size: 100% 100%;
      p{
        margin: 0;
      }
      .p1{
        color: #5ED0FF;
        font-size: 2.5vh;
        font-weight: bold;
      }
      .p2{
        color: #ccc;
        font-size: 1.6vh;
      }
    }
  }
}
</style>
